package com.stlm2.dems.entity.base;

import com.stlm2.dems.entity.OrderState;

import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by apple on 2017/10/20.
 */
public class BaseGoodsOrder {

    private Integer id;
    //一级订单编号
    private String purchaseOrderCode;
    //二级订单编号
    private String shopOrderCode;
    //订单编号
    private String code;
    //下单用户
    private Integer userId;
    //商品ID
    private Integer goodsId;
    //商品名称
    private String goodsName;
    //有无识别码
    private Boolean hasLmie;
    //市场价
    private BigDecimal marketPrice;
    //售后价  单价  会员价
    private BigDecimal salePrice;
    //叮当价
    private BigDecimal ddPrice;
    //购买数量
    private Integer num;
    //总金额
    private BigDecimal totalMoney;
    //支付金额
    private BigDecimal payMoney;
    //优惠金额
    private BigDecimal saveMoney;
    //总积分
    private BigDecimal totalIntegral;
    //创建时间
    private Date createTime;
    //订单状态
    private OrderState orderState;
    //是否可评论
    private Boolean hasComment;
    //商品规格ID
    private Integer goodsSpecificationId;
    //支付时间
    private Date payTime;
    //取消世间
    private Date cancelTime;
    //发货时间
    private Date deliverTime;
    //收货时间
    private Date receiptTime;
    //完成时间
    private Date finishTime;
    //退款时间
    private Date refundTime;
    //服务费用
    private BigDecimal serviceMoney;
    //分佣剩余金额
    private BigDecimal remainMoney;
    //卡券id
    private Integer cardId;
    //增值服务id 字符串拼接
    private String addServiceId;
    //商品识别码
    private String identifyCode;
    //购买增值服务个数
    private Integer serviceNum;
    //是否秒杀
    private Boolean seckill;
    //秒杀商品id
    private Integer seckillGoodsId;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getPurchaseOrderCode() {
        return purchaseOrderCode;
    }

    public void setPurchaseOrderCode(String purchaseOrderCode) {
        this.purchaseOrderCode = purchaseOrderCode;
    }

    public String getShopOrderCode() {
        return shopOrderCode;
    }

    public void setShopOrderCode(String shopOrderCode) {
        this.shopOrderCode = shopOrderCode;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public Boolean getHasLmie() {
        return hasLmie;
    }

    public void setHasLmie(Boolean hasLmie) {
        this.hasLmie = hasLmie;
    }

    public BigDecimal getMarketPrice() {
        return marketPrice;
    }

    public void setMarketPrice(BigDecimal marketPrice) {
        this.marketPrice = marketPrice;
    }

    public BigDecimal getSalePrice() {
        return salePrice;
    }

    public void setSalePrice(BigDecimal salePrice) {
        this.salePrice = salePrice;
    }

    public BigDecimal getDdPrice() {
        return ddPrice;
    }

    public void setDdPrice(BigDecimal ddPrice) {
        this.ddPrice = ddPrice;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public BigDecimal getTotalMoney() {
        return totalMoney;
    }

    public void setTotalMoney(BigDecimal totalMoney) {
        this.totalMoney = totalMoney;
    }

    public BigDecimal getTotalIntegral() {
        return totalIntegral;
    }

    public void setTotalIntegral(BigDecimal totalIntegral) {
        this.totalIntegral = totalIntegral;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public OrderState getOrderState() {
        return orderState;
    }

    public void setOrderState(OrderState orderState) {
        this.orderState = orderState;
    }

    public Boolean getHasComment() {
        return hasComment;
    }

    public void setHasComment(Boolean hasComment) {
        this.hasComment = hasComment;
    }

    public Integer getGoodsSpecificationId() {
        return goodsSpecificationId;
    }

    public void setGoodsSpecificationId(Integer goodsSpecificationId) {
        this.goodsSpecificationId = goodsSpecificationId;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public Date getCancelTime() {
        return cancelTime;
    }

    public void setCancelTime(Date cancelTime) {
        this.cancelTime = cancelTime;
    }

    public Date getDeliverTime() {
        return deliverTime;
    }

    public void setDeliverTime(Date deliverTime) {
        this.deliverTime = deliverTime;
    }

    public Date getReceiptTime() {
        return receiptTime;
    }

    public void setReceiptTime(Date receiptTime) {
        this.receiptTime = receiptTime;
    }

    public Date getFinishTime() {
        return finishTime;
    }

    public void setFinishTime(Date finishTime) {
        this.finishTime = finishTime;
    }

    public Date getRefundTime() {
        return refundTime;
    }

    public void setRefundTime(Date refundTime) {
        this.refundTime = refundTime;
    }

    public BigDecimal getServiceMoney() {
        return serviceMoney;
    }

    public void setServiceMoney(BigDecimal serviceMoney) {
        this.serviceMoney = serviceMoney;
    }

    public BigDecimal getRemainMoney() {
        return remainMoney;
    }

    public void setRemainMoney(BigDecimal remainMoney) {
        this.remainMoney = remainMoney;
    }

    public BigDecimal getPayMoney() {
        return payMoney;
    }

    public void setPayMoney(BigDecimal payMoney) {
        this.payMoney = payMoney;
    }

    public BigDecimal getSaveMoney() {
        return saveMoney;
    }

    public void setSaveMoney(BigDecimal saveMoney) {
        this.saveMoney = saveMoney;
    }

    public Integer getCardId() {
        return cardId;
    }

    public void setCardId(Integer cardId) {
        this.cardId = cardId;
    }

    public String getAddServiceId() {
        return addServiceId;
    }

    public void setAddServiceId(String addServiceId) {
        this.addServiceId = addServiceId;
    }

    public String getIdentifyCode() {
        return identifyCode;
    }

    public void setIdentifyCode(String identifyCode) {
        this.identifyCode = identifyCode;
    }

    public Integer getServiceNum() {
        return serviceNum;
    }

    public void setServiceNum(Integer serviceNum) {
        this.serviceNum = serviceNum;
    }

    public Boolean getSeckill() {
        return seckill;
    }

    public void setSeckill(Boolean seckill) {
        this.seckill = seckill;
    }

    public Integer getSeckillGoodsId() {
        return seckillGoodsId;
    }

    public void setSeckillGoodsId(Integer seckillGoodsId) {
        this.seckillGoodsId = seckillGoodsId;
    }

    /**
     * 订单状态
     * @return
     */
    public Integer getOrderStateValue(){
        return (orderState != null) ? orderState.getIntValue() : null;
    }

    public void setOrderStateValue(Integer v){
        if(v != null)
            orderState = OrderState.getByIntValue(v);
    }

}
